/*******************************************************************
 *
 * Copyright (C), 2021-2022, LS, All rights reserved.
 *
 * Author      : 
 * Create Time : 2021-09-17
 * Version     : v0.1
 * Description : 
 *******************************************************************/

#ifndef _OSAL_APP_H_
#define _OSAL_APP_H_

#include "ll.h"
#include "gap.h"
#include "types.h"
#include "bcomdef.h"
#include "peripheral.h"

/*********************************************************************
    INCLUDES
*/

/*********************************************************************
    CONSTANTS
*/


/** Wrist Task Events**/
//start
#define APP_UI_TICK_TIMER_EVT                   0x0001  //for UI timer event
#define APP_BUTTON_TIMER_EVT                    0x0002
#define APP_BATT_ADC_TIMER_EVT                  0x0004  //for battery detect
#define APP_BATT_CHG_CHK_TIMER_EVT              0x0008  //for battery check charge state
#define APP_SKIP_MAX_INV_TIMER_EVT              0x0010
#define APP_MOTOR_STOP_TIMER_EVT                0x0020
#define APP_DT_TICK_TIMER_EVT                   0x0040  //for datetime sync
#define APP_DELAY_RESET_EVT                     0x0080
#define APP_BTN_CLICK_TIMEOUT_EVT               0x0100

#define APP_TEST_EVT                            0x0100

/*********************************************************************
    MACROS
*/

/*********************************************************************
    FUNCTIONS
*/

extern uint8 osalApp_TaskID;
extern gaprole_States_t gapProfileState;

/*
    Task Initialization for the BLE Application
*/
extern void osalAppInit(uint8 task_id);

/*
    Task Event Processor for the BLE Application
*/
extern uint16 osalAppProcEvt( uint8 task_id, uint16 events );

extern void app_delay_reset(bool revert);

/*********************************************************************
*********************************************************************/


#endif /* _OSAL_APP_H_ */
